package br.perfiman.utils;

import java.io.File;
import java.io.IOException;

import org.jfree.chart.ChartFactory;
import org.jfree.chart.ChartUtilities;
import org.jfree.chart.JFreeChart;
import org.jfree.data.general.DefaultPieDataset;
import org.jfree.data.time.Month;
import org.jfree.data.time.TimeSeries;
import org.jfree.data.time.TimeSeriesCollection;
import org.jfree.data.xy.XYDataItem;
import org.jfree.data.xy.XYDataset;
import org.jfree.data.xy.XYSeries;
import org.jfree.data.xy.XYSeriesCollection;

public class Teste {
	public static void main(String[] args) throws IOException {
		TimeSeries series = new TimeSeries("Teste", Month.class);
		series.add(new Month(4, 2005), 3);
		series.add(new Month(1, 2007), 4);
		XYDataset dataset = new TimeSeriesCollection(series);
		
		
		DefaultPieDataset pieDataset = new DefaultPieDataset();
		pieDataset.setValue("A", 75);
		pieDataset.setValue("b", 175);
		pieDataset.setValue("c", 475);
		pieDataset.setValue("d", 575);
//		JFreeChart chart = ChartFactory.createPieChart("Teste", pieDataset, true, true, false);
		JFreeChart chart = ChartFactory.createTimeSeriesChart("Teste", "l1", "l2", dataset, true, true, false);
		ChartUtilities.saveChartAsPNG(new File("C:\\teste2.png"), chart, 500, 300);
	}
}
